<?php
if($loggedin)
{
$ds = mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."user WHERE userID='".$userID."'"));

//NEW MESSAGES
$msg_count = mysql_num_rows(safe_query("SELECT * FROM message WHERE receiver='".$userID."' AND isread='0'"));
$new_msg = '';
if($msg_count) {
$new_msg = '<span class="note">'.$msg_count.'</span>';
}

//MESSAGES
$messages = safe_query("SELECT * FROM message WHERE receiver='".$userID."' ORDER by date LIMIT 0,5");
$msg_list = '';
while($msg = mysql_fetch_array($messages))
{
eval ("\$msg_list = \"".gettemplate("msg_list")."\";");
$msg_list .= $msg_list;
}



eval ("\$loginform = \"".gettemplate("sc_logged")."\";");
echo $loginform;
}
else
{
$_SESSION['ws_sessiontest'] = true;
eval ("\$loginform = \"".gettemplate("sc_login")."\";");
echo $loginform;
}

?>